package view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JTextPane;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.undo.UndoManager;

public class EditeurUI extends JTextPane{
	UndoManager undoManager = new UndoManager();
	//JTextPane editeur = new JTextPane();
	
	public EditeurUI(){
		super();
		//editeur.setPreferredSize(new Dimension(400,200));
		this.setPreferredSize(new Dimension(400,200));
		this.setBorder((Border) (new LineBorder(Color.GRAY, 1)));
		//this.setBackground(Color.GRAY);
		this.setFont(new Font("Arial", this.getFont().getStyle(), 15));
	    this.setCaretColor(Color.BLUE);
		this.getDocument().addUndoableEditListener(undoManager);
		this.undoManager.setLimit(1000);
		
		//editeur.setFont(new Font("Arial", this.getFont().getStyle(), 15));
		//editeur.setCaretColor(Color.BLUE);
		//editeur.getDocument().addUndoableEditListener(undoManager);
		//editeur.undoManager.setLimit(1000);
		
		
		//this.add(editeur);
		this.setVisible(true);

	}
	
	public UndoManager getUndoManager() {
		return undoManager;
	}
	public void setUndoManager(UndoManager undoManager) {
		this.undoManager = undoManager;
	}
}
